@extends('layouts.layouts')
@section('title')
    <title>后台首页</title>
@endsection
@section('content')
    <link rel="stylesheet" href="/lib/layer/theme/default/layer.css"/>
    <script type="text/javascript" src="/lib/layer/layer.js"></script>
    <div class="content">
        <div class="header">
            <ul class="breadcrumb">
                <li>课程组作业列表</li>
                <li class="active">作业列表</li>
            </ul>
        </div>
        <div class="main-content">
            {{--<div class="btn-toolbar list-toolbar">--}}
                {{--<form class="form-inline" action="" method="get">--}}
                    {{--<a href="/train/course/add"><button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal" ><i class="fa fa-plus"></i> 新增</button></a>--}}
                    {{--<div class="form-group">--}}
                        {{--<input type="text" class="form-control" name="title" placeholder="课程标题" value="">--}}
                    {{--</div>--}}
                    {{--<button type="submit" class="btn btn-default">筛选</button>--}}
                {{--</form>--}}
            {{--</div>--}}
            {{--<ul class="nav nav-pills">--}}
                {{--<li role="presentation" class=" commonCourse"><a href="/course/list">课程</a></li>--}}
            {{--</ul>--}}
            <div class="row not_live_list" style="">
                <div class="col-sm-12 col-md-12">
                    <div class="panel panel-default">
                        <div class="panel-heading no-collapse">课程列表</div>
                        <table class="table table-bordered table-striped">
                            <thead>
                            <tr>
                                <th>编号</th>
                                <th>作业标题</th>
                                <th>作业描述</th>
                                <th>作业作者</th>
                                <th>浏览量</th>

                            </tr>
                            </thead>
                            <tbody>
                            @if(count($data) > 0)
                                @foreach($data as $v)
                                    <tr>
                                        <td>{{$v->id}}</td>
                                        <td><a href="/train/ask/answer/{{$v->id}}">{{$v->title}}</a></td>
                                        <td width="500">{{$v->description}}</td>
                                        <td>{{getUserName($v->user_id)?getUserName($v->user_id)->nickname:''}}</td>
                                        <td>{{$v->view}}</td>

                                    </tr>
                                @endforeach
                            @endif
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
    {{$data->render()}}
    <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="myModalLabel">课程列表</h4>
                </div>
                <div class="modal-body"></div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                    <button type="button" class="btn btn-primary">Save changes</button>
                </div>
            </div>
        </div>
    </div>

@endsection